﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Platform.LanguageProcessing
{

	/// <summary>
	/// Identifica a pessoa em que o verbo/frase está
	/// </summary>
	public struct PersonVerb
	{
		internal readonly byte type;
		public static readonly PersonVerb Unknow = new PersonVerb( Byte.MinValue );
		public static readonly PersonVerb FirstSingle = new PersonVerb( 1 );
		public static readonly PersonVerb SecondSingle = new PersonVerb( 2 );
		public static readonly PersonVerb ThirdSingle = new PersonVerb( 3 );
		public static readonly PersonVerb FirstPlural = new PersonVerb( 4 );
		public static readonly PersonVerb SecondPlural = new PersonVerb( 5 );
		public static readonly PersonVerb ThirdPlural = new PersonVerb( 6 );

		private PersonVerb( byte type )
		{
			this.type = type;
		}


		public override bool Equals( object obj )
		{
			if ( obj is PersonVerb )
			{
				return this.type == ( ( PersonVerb )obj ).type;
			}
			else
			{
				return false;
			}
		}

		public override int GetHashCode()
		{
			return this.type.GetHashCode();
		}

		public override string ToString()
		{
			return this.type.ToString();
		}

		public static bool operator ==( PersonVerb x1, PersonVerb x2 )
		{
			return x1.type == x2.type;
		}

		public static bool operator !=( PersonVerb x1, PersonVerb x2 )
		{
			return x1.type != x2.type;
		}


		public static bool IsSingle( PersonVerb person )
		{
			return person.type >= 1 && person.type <= 3;
		}

		public static bool IsPlural( PersonVerb person )
		{
			return person.type >= 4 && person.type <= 6;
		}
	}
}
